{% extends 'base.html' %}

{% block title %}
    讨论区
{% endblock %}

{% block head %}
    <link href="{{ static('css\carousel.css')}}" rel="stylesheet">
    <style>

        /* 整个carousel样式 */
        #carousel-example-generic {
            margin-top: 80px;
            height: 400px;
            margin-bottom: 80px;
        }

        /* 图片格子 */
        {##carousel-example-generic .carousel-inner > .item {#}
        {#    height: 400px;#}
        {#}#}

        /* 图片尺寸 */
        #carousel-example-generic .carousel-inner > .item > img {
            display: block;
            width:100%;
            height: 400px;
        }

        #right_block {
            margin-top: 80px;
            height: 540px;
            color: #5a5a5a;
        }


    </style>
{% endblock %}
 <!-- Custom styles for this template -->


{% block content %}
    <div class="row">
        {#  place holder  #}
        <div class="col-md-1"></div>

        {#  carousel #}
        <div id="carousel-example-generic" class="col-md-8 carousel slide" data-ride="carousel">
        <!-- Indicators -->
          <ol class="carousel-indicators">
            <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
            <li data-target="#carousel-example-generic" data-slide-to="1"></li>
            <li data-target="#carousel-example-generic" data-slide-to="2"></li>
          </ol>

          <!-- Wrapper for slides -->
          <div class="carousel-inner" role="listbox">
            <div class="item active">
              <img src="{{ static('img/S9_4.jpg')}}" alt="First slide">
              <div class="carousel-caption">
                ...
              </div>
            </div>
            <div class="item">
              <img id="S9_1" src="{{ static('img/S9_1.jpg')}}" alt="Second slide">
              <div class="carousel-caption">
                ...
              </div>
            </div>
            ...
          </div>

          <!-- Controls -->
          <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
            <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
            <span class="sr-only">Previous</span>
          </a>
          <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
            <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
            <span class="sr-only">Next</span>
          </a>
        </div>

        {#  右边栏 #}
        <div class="col-md-2 container thumbnail" id="right_block">
                <a href="#" >
                    <img class="img-circle" src="{{ static('img/FPX.png') }}" alt="..."
                         style="width: 150px; height: 150px; margin: 0 auto">
                </a>
                <h3>Thumbnail label</h3>
                <p>...</p>
    {#                    <p><a href="#" class="btn btn-primary" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a></p>#}
                <a role="button" class="btn btn-primary btn-lg" href="{{ url_for('front.apost') }}">
                    发布帖子
                </a>
                <ul class="nav nav-pills" role="tablist" style="margin-top: 20px; margin-left: 30px">
                    {% for board in boards %}
                        <li role="presentation">
                            <a href="#"><p class="text-primary">{{ board.name }}</p><span class="badge">{{ board.article_num }}</span></a>
                        </li>
                    {% endfor %}
                </ul>
        </div>
        {#  place holder  #}
        <div class="col-md-1"></div>
    </div>
    {% for article in articles %}
        <div class="row featurette">
        <div class="col-md-1"></div>

        <div class="col-md-2">
            <img class="featurette-image img-responsive center-block" src="{{ static('img/FPX.png') }}" alt="Generic placeholder image">
        </div>
        <div class="col-md-6">
            <h2 class="featurette-heading">
            <a href="{{url_for('front.article',article_id=article.id)}}">{{ article.title }}</a>
            <span class="text-muted">{{article.author.username}} </span></h2>
            <br>
            <p class="lead">发表时间：{{article.register_time}}</p>
        </div>

        {#  place holder  #}
        <div class="col-md-3"></div>

    </div>

    {% endfor %}

    <nav aria-label="Page navigation">
      <ul class="pagination">
        <li>
          <a href="#" aria-label="Previous">
            <span aria-hidden="true">&laquo;</span>
          </a>
        </li>
        <li class="active"><a href="#">1</a></li>
        <li><a href="#">2</a></li>
        <li><a href="#">3</a></li>
        <li><a href="#">4</a></li>
        <li><a href="#">5</a></li>
        <li>
          <a href="#" aria-label="Next">
            <span aria-hidden="true">&raquo;</span>
          </a>
        </li>
      </ul>
    </nav>

{% endblock %}